package edu.feignServer.feign;

import edu.FeignConfig.UserFeignConfig;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by JPhoebe on 2017/7/7.
 */
@FeignClient(value = "GroupService",configuration = UserFeignConfig.class)
public interface UserFeign {

    /**
     *  自定义Feign的配置,不会重写feignContract方法的contract时使用默认的Contract时使用requestMapping注解
     *  feign默认使用的springMVC的注解
     */
    @RequestMapping(value = "/group/{id}",method = RequestMethod.GET)
    String findGroup(@PathVariable(value = "id") long id);

    /**
     * 自定义Feign的配置,重写feignContract方法的contract时使用默认的Contract时使用requestLine注解，
     * 因为默认实现的contract只会对feign自身的注解进行扫描
     */
//    @RequestLine("GET /ribbon/user/{id}")
//    String findUserById(@Param(value = "id") long id);
}
